import java.util.Scanner;
import java.util.Arrays;

public class Solution2 {
    public static void main(String[] args) {
        Scanner num = new Scanner(System.in);
        int n = num.nextInt();
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = num.nextInt();
        }
        System.out.println(singleNumber(arr));
    }

    /**
     * 找出那个只出现了一次的元素
     * @param nums
     * @return
     */
    public static int singleNumber(int[] nums) {
        Arrays.sort(nums);
        int a = 0;
        for (int i = 0; i < nums.length; i++) {
            int flag = 0;
            int temp = nums[i];
            for (int j = 0; j < nums.length; j++) {
                if (temp == nums[j]) {
                    flag++;
                }
            }
            //System.out.print(flag + " ");
            if (flag == 1) {
                a = temp;
                break;
            }
        }
        return a;
    }
}
